package com.data;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author sad
 */
public class Universe {

    private String ip;
    private int port;
    private int subNet;
    private int index;
    private int position;
    private InetAddress inetAddress;
    private transient final int[] pixelMapping = new int[13 * 13];
    private transient int wheelIndexOffset;//смещение с которого будут начинаться "пиксели" отвечающие за колесо

    public int getWheelIndexOffset() {
        return wheelIndexOffset;
    }

    public void setWheelIndexOffset(int wheelIndexOffset) {
        this.wheelIndexOffset = wheelIndexOffset;
    }

    public int[] getPixelMapping() {
        return pixelMapping;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
        try {
            inetAddress = InetAddress.getByName(ip);
        } catch (UnknownHostException ex) {
            ex.printStackTrace();
        }
    }

    public InetAddress getInetAddress() {
        return inetAddress;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getSubNet() {
        return subNet;
    }

    public void setSubNet(int subNet) {
        this.subNet = subNet;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }

    @Override
    public String toString() {
        return "Universe " + position;
    }

}
